#include <stdio.h>
#include <stdlib.h>

int main()
{
    FILE *fp,*fb;
    int i=0,n=0,k=0;
    char ch[30][30]={{'0','0'}},a[30]={'0'};
    fp=fopen("123.txt","r");
    if(fp==NULL)
    {
        printf("Can't open the file!\n");
        exit(0);
    }
    fb=fopen("abc.txt","w");
    if(fb==NULL)
    {
        printf("Can't open the file!\n");
        exit(0);
    }
    while((fgets(ch[n],30,fp))!=NULL)
    {
     n++;
    }
    while(n<5)
    {
        if(ch[n]!='\0')
        {
            a[i]=ch[n][0];
            while(ch[n][k]!='\0')
            {
                a[i++]=ch[n][k];
                k++;
            }
            i++;
        }
        n++;

    }
    a[i+1]='\0';
    fputs(a,fb);
    fclose(fp);
    fclose(fb);
    return 0;
}
